package com.sk.bilibili.api;

import com.sk.bilibili.apiMapper.annotation.ApiMapper;
import com.sk.bilibili.apiMapper.annotation.FieldPath;
import com.sk.bilibili.apiMapper.annotation.RequestHead;
import com.sk.bilibili.apiMapper.constant.Method;
import com.sk.bilibili.bean.Live;
import com.sk.bilibili.dto.LiveData;

/**
 * @author 邵康
 * @date 2021/11/26 15:09
 */
@RequestHead(key = "referer",value = "https://www.bilibili.com/")
@RequestHead(key = "user-agent",value = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36")
@ApiMapper(value = "https://api.live.bilibili.com/",method = Method.GET)
public interface LiveApi {

    @ApiMapper("xlive/web-interface/v1/index/getList?platform=web")
    @FieldPath(value = "data.recommend_room_list",collection = true)
    LiveData[] getHeaderLive();

    @ApiMapper("room/v1/Room/playUrl?cid=${roomId}&amp;qn=0&amp;platform=web")
    @FieldPath(value = "data.durl[0].url")
    String getLiveUrl(Integer roomId);

    @ApiMapper("xlive/web-interface/v1/second/getUserRecommend?page=${page}&page_size=${size}&platform=web")
    @FieldPath(value = "data.list",collection = true)
    LiveData[] getRecommendLive(Integer page,Integer size);

    @ApiMapper("xlive/web-interface/v1/second/getList?platform=web&parent_area_id=${areaId}&area_id=0" +
            "&sort_type=${sort}&page=${page}")
    @FieldPath(value = "data.list",collection = true)//注意这里 areaId  就是parent_area_id
    LiveData[] getTypeLive(Integer areaId,String sort,Integer page);

}
